package com.serkol.ams.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.serkol.ams.entity.MiniPage;
import com.serkol.ams.mapper.MiniPageMapper;
import com.serkol.ams.service.MiniPageService;
import com.serkol.handler.MyLambdaQueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author pingan
* @description 针对表【mini_page】的数据库操作Service实现
* @createDate 2022-10-31 20:47:47
*/
@Service
public class MiniPageServiceImpl extends ServiceImpl<MiniPageMapper, MiniPage>
    implements MiniPageService{

    @Override
    public List<Map<String, Object>> listSelect() {
        MyLambdaQueryWrapper<MiniPage> queryWrapper = new MyLambdaQueryWrapper<>();
        queryWrapper.select(MiniPage::getPath).as("value").langName(MiniPage::getName,MiniPage::getNameUg).as("label");
        List<Map<String, Object>> maps = this.listMaps(queryWrapper);
        return maps;
    }

    @Override
    public boolean byDelete(long id) {
        if(id>0) {
            return this.removeById(id);
        }
        return false;
    }
}




